package cn.gson.work.model.pojos;

import javax.persistence.*;
import java.util.Objects;

@Entity
public class Tfil {
    private long fno;
    private String fid;
    private String fname;
    private String fsecurity;
    private String fstate;
    private String fborrower;
    private Dossier dossier;

    @Id
    @Column(name = "FNO")
    public long getFno() {
        return fno;
    }

    public void setFno(long fno) {
        this.fno = fno;
    }

    @Basic
    @Column(name = "FID")
    public String getFid() {
        return fid;
    }

    public void setFid(String fid) {
        this.fid = fid;
    }

    @Basic
    @Column(name = "FNAME")
    public String getFname() {
        return fname;
    }

    public void setFname(String fname) {
        this.fname = fname;
    }

    @Basic
    @Column(name = "FSECURITY")
    public String getFsecurity() {
        return fsecurity;
    }

    public void setFsecurity(String fsecurity) {
        this.fsecurity = fsecurity;
    }

    @Basic
    @Column(name = "FSTATE")
    public String getFstate() {
        return fstate;
    }

    public void setFstate(String fstate) {
        this.fstate = fstate;
    }

    @Basic
    @Column(name = "FBORROWER")
    public String getFborrower() {
        return fborrower;
    }

    public void setFborrower(String fborrower) {
        this.fborrower = fborrower;
    }

    @ManyToOne
    @JoinColumn(name="RSNO")
    public Dossier getDossier() {
        return dossier;
    }

    public void setDossier(Dossier dossier) {
        this.dossier = dossier;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Tfil tfil = (Tfil) o;
        return fno == tfil.fno &&
                Objects.equals(fid, tfil.fid) &&
                Objects.equals(fname, tfil.fname) &&
                Objects.equals(fsecurity, tfil.fsecurity) &&
                Objects.equals(fstate, tfil.fstate);
    }

    @Override
    public String toString() {
        return "Tfil{" +
                "fno=" + fno +
                ", fid='" + fid + '\'' +
                ", fname='" + fname + '\'' +
                ", fsecurity='" + fsecurity + '\'' +
                ", fstate='" + fstate + '\'' +
                ", fborrower='" + fborrower + '\'' +
                ", dossier=" + dossier +
                '}';
    }

    @Override
    public int hashCode() {
        return Objects.hash(fno, fid, fname, fsecurity, fstate);
    }
}
